package com.it.mapper;

import com.it.bean.Student;
import com.it.provider.StudentProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

public interface StudentMapper {

    Student selectById(@Param("id") String id);

    // 注解sql和xml同时存在会报错，因为statement存储在Map集合，key不可重复
    // @Select("select id, name, gender, major, grade from student")
    List<Student> selectAll();

    @SelectProvider(type = StudentProvider.class, method = "queryByCondition")
    List<Student> selectByCondition(@Param("name") String name);

    Integer insertBatch(@Param("list") List<Student> list);

    List<Student> selectDefines(@Param("id") String id);
}




